

package jetbrains.buildServer.server.rest.errors;

import javax.ws.rs.core.Response;
import javax.ws.rs.ext.Provider;
import jetbrains.buildServer.server.rest.jersey.ExceptionMapperBase;
import org.jetbrains.annotations.NotNull;
import org.springframework.stereotype.Component;

/**
 * User: Yegor Yarko
 * Date: 30.03.2009
 */
@Component
@Provider
public class InvalidStateExceptionMapper extends ExceptionMapperBase<InvalidStateException> {
  @Override
  public ResponseData getResponseData(@NotNull final InvalidStateException e) {
    return new ResponseData(Response.Status.CONFLICT, "Cannot process this request at this time. Repeat later.");
  }
}